package com.whw.fy.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Transient;
import java.util.Date;

@Data
@ApiModel(value="com-whw-fy-entity-FourEntity")
public class FourEntity {
    //这是area表
    /**
     * 领域评估id
     */
    @ApiModelProperty(value = "领域评估id ,")
    private Integer areaId;

    /**
     * 领域类型id
     */
    @ApiModelProperty(value = "这个是area表的领域类型id,")
    private Integer areaTypeId;

    /**
     * 学生id
     */
    @ApiModelProperty(value = "学生id")
    private Integer areaStudentId;

    /**
     * 优势
     */
    @ApiModelProperty(value = "优势")
    private String areaAdvantages;

    /**
     * 劣势
     */
    @ApiModelProperty(value = "劣势")
    private String areaDisadvantages;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String areaRemarks;

    public Area area(FourEntity fourEntity) {
        Area area = new Area();
//        area.setAreaId(fourEntity.areaId);
        area.setAreaTypeId(fourEntity.areaTypeId);
        area.setAreaStudentId(fourEntity.areaStudentId);
        area.setAreaAdvantages(fourEntity.areaAdvantages);
        area.setAreaDisadvantages(fourEntity.areaDisadvantages);
        area.setAreaRemarks(fourEntity.areaRemarks);
        return area;
    }
//这是areaType表
    /**
     * 领域类型id
     */
    @ApiModelProperty(value="这个是areaType表的领域类型id")
    private Integer areaTypeIds;

    /**
     * 领域名称
     */
    @ApiModelProperty(value="领域名称")
    private String areaName;

    public AreaType areaType (FourEntity fourEntity){
        AreaType areaType = new AreaType();
//        areaType.setAreaTypeId(fourEntity.areaTypeIds);
        areaType.setAreaName(fourEntity.areaName);
        return areaType;
    }
    //这是plan表

    /**
     * 教学计划id
     */
    @ApiModelProperty(value = "教学计划id")
    private Integer planId;

    /**
     * 学生id
     */
    @ApiModelProperty(value = "学生id")
    private Integer planStudentId;

    /**
     * 计划制定日期
     */
    @ApiModelProperty(value = "计划制定日期")
    @JsonFormat(pattern="yyyy-MM-dd")
    private Date planTime;

    /**
     * 计划执行周期
     */
    @ApiModelProperty(value = "计划执行周期")
    @JsonFormat(pattern="yyyy-MM-dd")
    private String planExcutecycle;

    /**
     * 计划实施阶段
     */
    @ApiModelProperty(value = "计划实施阶段")
    private String planStage;

    /**
     * 教学主管id
     */
    @ApiModelProperty(value = "教学主管id")
    private Integer planTeacherleaderId;

    /**
     * 康复主管id
     */
    @ApiModelProperty(value = "康复主管id")
    private Integer planRecoveryleaderId;

    /**
     * 主管医师id
     */
    @ApiModelProperty(value = "主管医师id")
    private Integer planPhysicianleaderId;

    /**
     * 计划实施人员id
     */
    @ApiModelProperty(value = "计划实施人员id")
    private Integer planPeopleId;

    /**
     * 讲解日期
     */
    @ApiModelProperty(value = "讲解日期")
    @JsonFormat(pattern="yyyy-MM-dd")
    private Date planExplaintime;

    /**
     * 讲解人员id
     */
    @ApiModelProperty(value = "讲解人员id")
    private Integer planExplainpeopleId;

    /**
     * 评估类型
     */
    @ApiModelProperty(value = "评估类型")
    private String planAccessmenttype;

    /**
     * 评估综述
     */
    @ApiModelProperty(value = "评估综述")
    private String planAccessmentinfo;

    /**
     * 领域评估记录id 以";"形式隔开
     */
    @ApiModelProperty(value = "领域评估记录id 以';'形式隔开")
    private String planAreaId;

    /**
     * 训练计划综述
     */
    @ApiModelProperty(value = "训练计划综述")
    private String planSummarize;

    /**
     * 训练计划id 以";"形式隔开
     */
    @ApiModelProperty(value = "训练计划id 以';'形式隔开")
    private String planSummarizeId;

    /**
     * 领域类型id
     */
    @ApiModelProperty(value = "领域类型id")
    private Integer planAreaTypeId;
    /**
     * 计划时间
     */
    @Transient
    @ApiModelProperty(value = "计划时间(传这个)")
    private String planTimeToString;
    @Transient
    @ApiModelProperty(value = "讲解时间(传这个)")
    private String planExplaintimeToString;

    public Plan plan (FourEntity fourEntity){
        Plan plan =new Plan();
//        plan.setPlanId(fourEntity.planId);
        plan.setPlanStudentId(fourEntity.planStudentId);
        plan.setPlanTime(fourEntity.planTime);
        plan.setPlanExcutecycle(fourEntity.planExcutecycle);
        plan.setPlanStage(fourEntity.planStage);
        plan.setPlanTeacherleaderId(fourEntity.planTeacherleaderId);
        plan.setPlanRecoveryleaderId(fourEntity.planRecoveryleaderId);
        plan.setPlanPhysicianleaderId(fourEntity.planPhysicianleaderId);
        plan.setPlanPeopleId(fourEntity.planPeopleId);
        plan.setPlanExplaintime(fourEntity.planExplaintime);
        plan.setPlanAccessmenttype(fourEntity.planAccessmenttype);
        plan.setPlanAccessmentinfo(fourEntity.planAccessmentinfo);
        plan.setPlanAreaId(fourEntity.planAreaId);
        plan.setPlanSummarize(fourEntity.planSummarize);
        plan.setPlanSummarizeId(fourEntity.planSummarizeId);
        plan.setPlanTimeToString(fourEntity.planTimeToString);
        plan.setPlanExplaintimeToString(fourEntity.planExplaintimeToString);
        return plan;
    }
    //planSummarTable表
    /**
     * 训练计划id
     */
    @ApiModelProperty(value="训练计划id")
    private Integer planSummarizeTableId;

    /**
     * 领域类型id
     */
    @ApiModelProperty(value="领域类型id")
    private Integer planSummarizeTableAreaTypeId;

    /**
     * 教学项目
     */
    @ApiModelProperty(value="教学项目")
    private String planSummarizeTableTeachprogram;

    /**
     * 教学活动
     */
    @ApiModelProperty(value="教学活动")
    private String planSummarizeTableTeachactivity;

    /**
     * 完成标准
     */
    @ApiModelProperty(value="完成标准")
    private String planSummarizeTableFinishstandard;

    /**
     * 计划开始日期
     */
    @ApiModelProperty(value="计划开始日期")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date planSummarizeTableStarttime;

    /**
     * 计划完成日期
     */
    @ApiModelProperty(value="计划完成日期")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-d HH:mm:ss")
    private Date planSummarizeTableFinishtime;

    @Transient
    private String PlanSummarizeTableStarttimeToString;

    @Transient
    private String PlanSummarizeTableFinishtimeToString;

    public PlanSummarizeTable planSummarizeTable (FourEntity fourEntity){
        PlanSummarizeTable planSummarizeTable = new PlanSummarizeTable();
        planSummarizeTable.setPlanSummarizeTableId(fourEntity.planSummarizeTableId);
        planSummarizeTable.setPlanSummarizeTableAreaTypeId(fourEntity.planSummarizeTableAreaTypeId);
        planSummarizeTable.setPlanSummarizeTableTeachprogram(fourEntity.planSummarizeTableTeachprogram);
        planSummarizeTable.setPlanSummarizeTableTeachactivity(fourEntity.planSummarizeTableTeachactivity);
        planSummarizeTable.setPlanSummarizeTableFinishstandard(fourEntity.planSummarizeTableFinishstandard);
        planSummarizeTable.setPlanSummarizeTableStarttime(fourEntity.planSummarizeTableStarttime);
        planSummarizeTable.setPlanSummarizeTableFinishtime(fourEntity.planSummarizeTableFinishtime);
        planSummarizeTable.setPlanSummarizeTableStarttimeToString(fourEntity.PlanSummarizeTableStarttimeToString);
        planSummarizeTable.setPlanSummarizeTableFinishtimeToString(fourEntity.PlanSummarizeTableFinishtimeToString);
        return planSummarizeTable;
    }
}
